package com.asset.common.enums;

/**
 * 交易方向（D支出，C收入）
 */
public enum EnumTradingDirectionType {

    PAY("P","支出"),
    INCOME("I","收入"),
    ;

    private String code;

    private String message;

    EnumTradingDirectionType(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static EnumTradingDirectionType getEnum(String code) {
        if (code == null) {
            return null;
        }
        for (EnumTradingDirectionType value : EnumTradingDirectionType.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
